import java.util.Scanner;

public class JClassTest {
    public static void main(String[] args) {
        JClass j76 = new JClass();
        j76.name = "课工场76班";
        j76.startTime = "2021-9-15";
        j76.dirTeacher = "老李";
        j76.techTeacher = "老刘";
        Scanner in = new Scanner(System.in);
        int choice = 0;
        while (true) {
            System.out.println("1:添加新生，2：显示全部,3:查找学生，4，修改学生信息，5,查看班级人数9：退出");
            choice = in.nextInt();
            if (choice == 1) {
                System.out.print("请输入新生姓名：");
                String sname = in.next();
                j76.add(sname);
            } else if (choice == 2) {
                j76.printInfor();
            } else if (choice == 3) {
                System.out.println("你要找谁？");
                String sname = in.next();
                System.out.println("从第几个开始找：");
                int start = in.nextInt();
                start-=1;
                System.out.println("找到第几个结束：");
                int end = in.nextInt();
                end-=1;
                boolean b = j76.search(sname,start,end);
                System.out.println(b ? "在这个班" : "不在!");
            } else if (choice == 4) {
                System.out.println("请输入修改学生的姓名");
                String oldsname = in.next();
                System.out.println("请输入新名字：");
                String newsname = in.next();
                boolean b = j76.modify(oldsname,newsname);
                System.out.println(b ? "修改成功" : "修改失败!");
            } else if (choice == 5) {
                System.out.println(j76.pos);

            } else if (choice == 9) {
                break;
            }
        }
        System.out.println("结束了。。。");
    }
}
